﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace TecentCOS.Controllers
{
    public class WaterMarkController : Controller
    {
        /// <summary>
        /// 缩放
        /// </summary>
        /// <returns></returns>
        public ActionResult add()
        {

            return View();
        }
        /// <summary>
        /// 裁剪
        /// </summary>
        /// <returns></returns>
        public ActionResult extract()
        {
            return View();
        }


        public JsonResult GetBuckets()
        {
            var res = TecentCosService.Instance().GetBuckets();
            return Json(new List<string> { "123" }, JsonRequestBehavior.AllowGet);
        }

        [HttpPost]
        public ActionResult FileUpload()
        {
            HttpFileCollectionBase files = Request.Files;

            if (files.Count > 0)
            {
                var file = files[0];
                return File(file.InputStream, file.ContentType);
            }
            return Json("未找到文件");
            //foreach (HttpPostedFileBase file in files)
            //{
            //    file.
            //}

        }

    }
}